const Koa = require("koa");

const app = new Koa();

app.use(ctx => {
  let data = "";

  ctx.req.on("data", chunk => {
    data += chunk;
  });

  ctx.req.on("end", () => {
    data = decodeURI(data);
  });

  ctx.body = data;
});

app.listen(3000, () => {
  console.log(`app is running at: http://localhost:3000`);
});
